package day17.homework;

public class Test6 {
    public static void main(String[] args) {
        /*
        // 创建不同类型的动物
        Cat cat = new Cat("Whiskers", "Orange");
        Dog dog = new Dog("Buddy", 3);
        Bird bird = new Bird("Tweety", 0.5);

        // 测试动物的行为
        System.out.println("=== 动物园测试 ===");
        
        // 测试猫
        System.out.println("\n--- 猫 ---");
        System.out.println("名字: " + cat.getName());
        System.out.println("颜色: " + cat.getColor());
        cat.makeSound();
        cat.move();

        // 测试狗
        System.out.println("\n--- 狗 ---");
        System.out.println("名字: " + dog.getName());
        System.out.println("年龄: " + dog.getAge());
        dog.makeSound();
        dog.move();

        // 测试鸟
        System.out.println("\n--- 鸟 ---");
        System.out.println("名字: " + bird.getName());
        System.out.println("翼展: " + bird.getWingSpan() + "米");
        bird.makeSound();
        bird.move();

        // 测试多态
        System.out.println("\n=== 多态测试 ===");
        Animal[] animals = {cat, dog, bird};
        for (Animal animal : animals) {
            System.out.println("\n--- " + animal.getName() + " ---");
            animal.makeSound();
            animal.move();
        }
        */

        Animal cat = new Cat("tom", "灰白");
        Animal dog = new Dog("旺财", 5);
        Animal bird = new Bird("樱桃", 25.76);
        cat.makeSound();
        cat.move();
        dog.makeSound();
        dog.move();
        bird.makeSound();
        bird.move();

    }
}